]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Call set_allocation before allocating child
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 10 Mar 2020 10:05:13 +0000 (11:05 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Apr 2020 17:53:20 +0000 (19:53 +0200)
It's important to update the allocation of the parent before allocating
its children, it's an assumption we make in a lot of places.

This broke resource scale calculation for boxpointers and their
children when multiple monitors with different scales are used and the
primary monitor is not positioned at x=0, y=0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1615

js/ui/boxpointer.js

index 03cb4a567f66bf28983a26bc080a522fd9ffb8d6..60540621d2c0040da4185efac73230d71668d861 100644 (file)
@@ -197,6 +197,11 @@ var BoxPointer = GObject.registerClass({
     }
 
     vfunc_allocate(box, flags) {
+        if (this._sourceActor && this._sourceActor.mapped) {
+            this._reposition(box);
+            this._updateFlip(box);
+        }
+
         this.set_allocation(box, flags);
 
         let themeNode = this.get_theme_node();
@@ -230,12 +235,6 @@ var BoxPointer = GObject.registerClass({
             break;
         }
         this.bin.allocate(childBox, flags);
-
-        if (this._sourceActor && this._sourceActor.mapped) {
-            this._reposition(box);
-            this._updateFlip(box);
-            this.set_allocation(box, flags);
-        }
     }
 
     _drawBorder(area) {